package com.alog.senior.day20;

import java.io.*;

/**
 * @Auther: Ye Zhengdong
 * @Date: 2019/1/24 10:30
 * @Description:
 */
public class CopyFile {
    public static void main(String[] args) throws IOException {
//        File file = new File("aaa.txt");
//        System.out.println(file.getAbsolutePath());
        InputStream in = new FileInputStream("aaa.txt");
        OutputStream out = new FileOutputStream("aaa_bak.txt");
        byte[] buf = new byte[1024];
        int len = 0;
        while((len = in.read(buf)) != -1){
            out.write(buf, 0 , len);
        }
        out.flush();
        out.close();
        in.close();
    }
}
